package com.fysports.web.model.system;

import com.jfinal.log.Log;
import com.fysports.web.model.BaseModel;

import java.util.Date;

/**
* Class title: DB实体 - sys_dict - 字典表 <br/>
* Describe:                    <br/>
* Created by [CodeGenerator]   <br/>
* Date : 2016-01-08 02:41:06       <br/>
* Project : weixin           <br/>
*/
public class SystemDict extends BaseModel<SystemDict>{
    /**/
    private static Log log = Log.getLog(SystemDict.class);
    public final static SystemDict dao = new SystemDict();
    /*数据库字段静态变量*/
    /** type   */
    public final static String COL_TYPE="type";
    /** name   */
    public final static String COL_NAME="name";
    /** value   */
    public final static String COL_VALUE="value";
    /** level   */
    public final static String COL_LEVEL="level";
    /** ismodify  是否可修改key,1可修改,0不可修改 */
    public final static String COL_ISMODIFY="ismodify";
    /** remark   */
    public final static String COL_REMARK="remark";
    public SystemDict() {
        if (this.getStr(COL_UUID) == null || this.getStr(COL_UUID).length() == 0) {
        this.set(COL_UUID, generateUUID());
        }
    }

    public synchronized String getLastOrderSn(){
        SystemDict sd=dao.searchFirst(COL_NAME,"biz_order_sn");
        String s=sd.getValue();
        //取值后自动+1
        sd.setValue(String.valueOf((Long.valueOf(s)+1L)));
        sd.update();
        return s;
    }

    public String getType(){
            return this.getStr(COL_TYPE);
    }
    public void setType(String type){
        this.set(COL_TYPE,type);
    }
    public String getName(){
            return this.getStr(COL_NAME);
    }
    public void setName(String name){
        this.set(COL_NAME,name);
    }
    public String getValue(){
            return this.getStr(COL_VALUE);
    }
    public void setValue(String value){
        this.set(COL_VALUE,value);
    }
    public Integer getLevel(){
            return this.getInt(COL_LEVEL);
    }
    public void setLevel(Integer level){
        this.set(COL_LEVEL,level);
    }
    public String getIsmodify(){
            return this.getStr(COL_ISMODIFY);
    }
    public void setIsmodify(String ismodify){
        this.set(COL_ISMODIFY,ismodify);
    }
    public String getLiveflag(){
            return this.getStr(COL_LIVEFLAG);
    }
    public void setLiveflag(String liveflag){
        this.set(COL_LIVEFLAG,liveflag);
    }
    public Date getCreatetime(){
            return this.getDate(COL_CREATETIME);
    }
    public void setCreatetime(Date createtime){
        this.set(COL_CREATETIME,createtime);
    }
    public String getRemark(){
            return this.getStr(COL_REMARK);
    }
    public void setRemark(String remark){
        this.set(COL_REMARK,remark);
    }
}